#ifndef COLORLEGEND_H
#define	COLORLEGEND_H

#include <rfftw.h>
#include <string>
#include "ColorMap.h"


class ColorLegend
{    
    double d_width;
    double d_height;
    double d_xpos;
    double d_ypos;
    
    
    int d_numColors;
    bool d_banded;
    
    ColorMap *d_map;
    
    double d_min;
    double d_max;   
    
    double d_dx;
    double d_dy;
    
    std::string d_name;
    
    public:
        
        ColorLegend();
        ColorLegend(double width, double height, double x, double y, ColorMap *map, std::string const &nm);
        ColorLegend(double width, double height, double x, double y, int num_colors);
        
        void setUnits(double x, double y);
        void draw();
        

        
    private:
        
        void drawColorsCont();
        void drawColorsDisc();
        void drawBorders();
        void drawBackground();
        void drawNumbers();
};



void drawBitmapText(std::string const &str, double x, double y, int size);

#endif	/* COLORLEGEND_H */

